package com.xdcplus.web.controller.report;

import com.xdcplus.exceptions.domain.ResponseVO;
import com.xdcplus.mom.controller.AbstractController;
import com.xdcplus.pager.vo.PageVO;
import com.xdcplus.web.common.pojo.dto.task.JobTaskSwysFilterDTO;
import com.xdcplus.web.common.pojo.entity.DwWorkConf;
import com.xdcplus.web.common.pojo.vo.task.JobTaskSwysVO;
import com.xdcplus.web.service.DmSortingService;
import com.xdcplus.web.service.task.JobTaskSwysService;
import io.swagger.annotations.Api;
import io.swagger.annotations.ApiOperation;
import lombok.AllArgsConstructor;
import lombok.extern.slf4j.Slf4j;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.http.MediaType;
import org.springframework.validation.annotation.Validated;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;

import javax.validation.Validation;


/**
 */
@Api(tags = "报表清洗api")
@Slf4j
@Validated
@RestController
@AllArgsConstructor
@RequestMapping("api/wash")
public class DmSortingController extends AbstractController {

    @Autowired
    private DmSortingService dmSortingService;

    @ApiOperation("分选测试数据补偿")
    @GetMapping(value = "", produces = MediaType.APPLICATION_JSON_VALUE)
    public ResponseVO findJobTaskSwys(DwWorkConf dwWorkConf) {
        dmSortingService.compensateBuildData(dwWorkConf);
        return ResponseVO.success();
    }

    @ApiOperation("测试分选测试清洗")
    @GetMapping(value = "/test", produces = MediaType.APPLICATION_JSON_VALUE)
    public ResponseVO test(DwWorkConf dwWorkConf) {
        dmSortingService.execute(dwWorkConf);
        return ResponseVO.success();
    }

}
